﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DotNet.Edu.Service;
using DotNet.Edu.WebUtility;
using DotNet.Extensions;

namespace DotNet.StudentWap.Controllers
{
    [DomainLogIn]
    public class StudentController : StudentWapController
    {
        public ActionResult StudentInfo()
        {
            return View();
        }

        public ActionResult LearnHistory()
        {
            return View();
        }

        public ActionResult LearnHistoryGrid()
        {
            var list = EduService.LessonLog.GetPageList(PageInfo(), CurrentStudent.StudentId);
            return View(list);
        }

        public ActionResult LearnHistoryDetails(string id)
        {
            var entity = EduService.LessonLog.Get(id);
            return View(entity);
        }

        public ActionResult StudentAudits()
        {
            return View();
        }

        public ActionResult StudentAuditsGrid()
        {
            var list = EduService.StudentAudits.GetPageList(PageInfo(), CurrentStudent.StudentId);
            return View(list);
        }

        public ActionResult StudentAuditsDetails(string id)
        {
            var entity = EduService.StudentAudits.Get(id);
            return View(entity);
        }

        public ActionResult ExamRecord()
        {
            var list = EduService.ExamRecord.GetList(CurrentStudent.Student.IDCardNo);
            return View(list);
        }

        public ActionResult TrainHistory()
        {
            var list = EduService.Student.GetTrainHistoryList(CurrentStudent.StudentId);
            return View(list);
        }

        public ActionResult Notice()
        {
            return View();
        }

        public ActionResult NoticeGrid()
        {
            var list = EduService.Notice.GetPageList(PageInfo(), null, null, null);
            return View(list);
        }

        public ActionResult NoticeDetails(string id)
        {
            var entity = EduService.Notice.Get(id);
            return View(entity);
        }

        public ActionResult PeriodDetails()
        {
            ViewBag.learnPeriod = CurrentStudent.Student.TotalPeriod;
            return View();
        }

        public ActionResult PeriodDetailsGrid(string startDate, string endDate)
        {
            var list = EduService.PeriodDetails.GetStudentPageList(PageInfo(), CurrentStudent.StudentId,
                startDate.ToDateTimeOrNull(), endDate.ToDateTimeOrNull());
            return View(list);
        }

        public ActionResult PeriodDetailsDetails(string id)
        {
            var entity = EduService.PeriodDetails.Get(id);
            return View(entity);
        }
    }
}